const jwt = require("jsonwebtoken");

const SIGN_KEY = "qaz123)_+";

class Jwt {
  static getToken(userData) {
    return jwt.sign(userData, SIGN_KEY, { expiresIn: '7d' });
  }

  static verify(token) {
    try {
      return jwt.verify(token, SIGN_KEY);
    } catch (err) {
      return null;
    }
  }
}
module.exports = Jwt;
